mcmodhelpfandomcom-20200213-history
Eclipse Setup
Eclipse is a free, donatable Integrated Development Environment (IDE). It is easy to use and can support several different programming languages with a plugin or two. I will be showing you how to set up Eclipse to make 1.8 mods. Also, this tutorial is based on Windows 8 and 10, but Windows Vista and 7 should be almost identical in structure. Downloading Eclipse # The first step to set up is to, you guessed it, download Eclipse. Make sure to download the IDE for Java Developers which can be found here. # After the program is downloaded, start it up and make sure everything works. If everything is okay, your ready to start setting up your modding environment. Setting up the Modding Environment Before we do anything you will need to set up your environment variables for the Java Development Kit you just downloaded. If you did not do so click here to learn how. # Navigate to Control Panel > System > System and Security # On the far left hand panel there should be an option called Advanced System Settings. Click that. # This should bring up the System Properties dialog. At the bottom of this window click on the Environment Variables button. # Inside this window, there will be two panels. No need to worry about the top one, but on the bottom one, there will be several variables with various directories. We are looking for one called Path. BE VERY CAREFUL THAT YOU DO NOT DELETE ANYTHING. This will possibly ruin your computer and cause your OS to run slow or crash. # Once you have found it, click the Edit button located below the pane. Now you will need to open up a file browser and search for your Java JDK directory. If you are running Windows, it is found by default in C: > Program Files > Java > jdk version > bin. Once you are inside the bin folder, copy the current directory and paste it into the Edit field of the Environment Variables dialog. Be sure to include quotes around the directory and add a semicolon at the end so that it looks something like this: "C:\Program Files\Java\jdk1.8.0_45\bin"; # Click OK and exit out of the Control Panel. Downloading Forge and Creating the Custom Eclipse Workspace The first thing you'll want to do is to create a folder where you will put all of the build files, as well as the resources for you mod. I will call this folder the resources folder. It doesn't matter where this folder is as long as you can access it easily and frequently. # Once you have your folder made, download the latest version of Mincraft Forge, here, making sure to download the Src package. Take this file, which is usually in the form of a .zip archive, and extract everything into the resources folder you just created. # Now, within the resources folder, we are going to make three new .bat files. To do this, make three new text files and set them up as follows: ## The first one should be called setup workspace.bat. Make sure to replace the .txt extension with .bat. Right click on the file and click Edit. This should open a blank text file, on which you will type "gradlew setupDecompWorkspace" without quotes. Save and exit the file. ## Call the next one setup eclipse.bat. Make sure to replace the .txt extension with .bat. Right click on the file and click Edit. This should open a blank text file, on which you will type "gradlew eclipse" without quotes. Save and exit the file. ## Create a third file called build.bat. I will not be covering how to set up this file in this tutorial, because this is the file that compiles your mod into a .jar file that can be shared. Therefore, this file does not need to have anything in it, but to distribute the mod, this will need to be filled out. For a tutorial on how to compile and distribute the mod, check out Compiling/Distributing Your Mod. # You should now have three bat files in your folder along with the ForgeSrc files you downloaded. # Now double-click on the setup workspace.bat file. A command prompt should open showing the building progress of the workspace. Allow this time to complete, and once it is done, do the same for setup eclipse.bat. # Now, after all of the setup files have run and completed, run Eclipse. A window should popup asking for a workspace. Luckily, ForgeSrc comes with a workspace specifically for modding. Click Browse and navigate to your resource folder and click on the eclipse folder therin. Click OK and wait for the workspace to load. Once the workspace has finished loading, you should be presented with a blank environment with a "Minecraft" project in the project explorer on the left. Congratulations! You are now ready to begin coding your mod!